package com.example.sunny.utils

import android.content.Context
import android.net.ConnectivityManager

object NetUtils {

    fun isNetWorkConnected(context: Context):Boolean{
        if (context!=null){
            val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
            val networkInfo = connectivityManager.activeNetworkInfo
            if (networkInfo!=null){
                return networkInfo.isAvailable
            }
        }
        return false

    }
}